<div class="orders view">
<div class="actions specific">
	<ul>
		<li><?php
                if($order['Order']['date_recibed'] == NULL){
                    echo $this->Html->link(__('Confirmar', true), array('action' => 'confirm', $this->Form->value('Order.id'))); 
                }
                ?> </li>
		<li><?php echo $this->Html->link(__('Editar Pedido', true), array('action' => 'edit', $order['Order']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Eliminar Pedido', true), array('action' => 'delete', $order['Order']['id']), null, sprintf(__('Esta seguro que desea eliminar # %s?', true), $order['Order']['id'])); ?> </li>
	</ul>
</div>
<h2><?php  __('Pedido');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $order['Order']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Fecha Emision'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php 
                        $fecha = date('d/m/Y', strtotime($order['Order']['date']));
                        echo $fecha; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Cantidad'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $order['Order']['amount']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Articulo'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $this->Html->link($order['Article']['mark'] . '-' . $order['Article']['model'], array('controller' => 'articles', 'action' => 'view', $order['Article']['id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Proveedor'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $this->Html->link($order['Supplier']['name'], array('controller' => 'suppliers', 'action' => 'view', $order['Supplier']['id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Fecha Recibido'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php
                        if($order['Order']['date_recibed'] != NULL){
                            $fecha = date('d/m/Y', strtotime($order['Order']['date']));
                            echo $fecha;    
                        }else{
                            echo $order['Order']['date_recibed']; 
                        }
                        ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Cantidad Recibida'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $order['Order']['amount_recibed']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
